fix: use server-side pagination for conference list tab#21
Conversation
The conference list tab now fetches one page at a time from the API using ?limit=20&offset=N instead of loading all conferences into memory and slicing with JavaScript. - Graphs tab still loads all conferences (fast now without expand_fields) - Conference list tab fetches paginated data via API - Pagination controls emit page-changed event to trigger API fetch - Loading state shown while fetching - Backward compatible: graphs/filters still work with full conference data
The API list endpoint no longer returns issues (expand_fields removed in api#19). The hasError/hasWarning helpers crashed when conference.issues was undefined. Added null check so charts render without issues data.
The participant conferences tab accessed conference.issues.length without checking if issues exists. With expand_fields removed from the API list endpoint, this would crash.
|
The conference list was missing error/warning icons after expand_fields was removed. Now uses has_errors and has_warnings boolean flags from the API (annotated via Exists() subquery, no N+1).
All four API calls (issues, conferences, sessions, connections) now pass created_at_gte using the daysHistory value (30 days). This prevents the dashboard from loading months of historical data when the dataset grows. Sessions endpoint already enforces a 30-day limit server-side, so the param is redundant there but consistent.
|
@codex review, does page changes trigger a new API call instead of slicing in-memory arrays? Does this mean that we aren't using Redis cache to optimize reads? |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec4a631abb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const response = await peermetrics.get(peermetrics.urls.conferences(), { | ||
| appId: peermetrics.app.id, | ||
| limit: this.conferencesPerPage, | ||
| offset: offset, |
There was a problem hiding this comment.
Keep pagination query scoped to dashboard history window
The new fetchConferences() request drops the created_at_gte filter that created() now applies to issues/sessions/connections and the full conference dataset, so the paginated conference tab can pull a different (all-time) dataset than the graphs and empty-state logic. On apps with older conferences, this causes inconsistent UI (e.g., graphs show only recent history while list/pagination counts include older rows) and unnecessary reads outside the intended time window.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
I believe the bot's concern is likely a false positive in our case.
The pagination is doing its job correctly:
The list shows X conferences at a time (one page) — that's expected
The charts show aggregated data across a broader dataset — also expected and intentional
These two views are supposed to show different scopes.
| <div class="tab-pane fade" id="conferences" role="tabpanel" aria-labelledby="conferences-tab"> | ||
| <conferences-tab :conferences="conferences" /> | ||
| <conferences-tab | ||
| :conferences="paginatedConferences" |
There was a problem hiding this comment.
Preserve dashboard filters for conference list tab
Binding the list tab to paginatedConferences bypasses applyFilters(), which still only updates this.conferences based on the selected app version/browser/OS/country watchers. After this change, changing filters updates graphs but leaves the conference list unfiltered, which is a behavior regression from the previous wiring and makes the global filter UI inconsistent across tabs.
Useful? React with 👍 / 👎.
|
@agonza1 we are not using Redis, the redis we have is for mostly rate limiting. But I can make sure changes to use the redis to cache the data as well |
@Boanerges1996 I believe cache is used on code paths that call Model.get(...) from BaseModel (basemodel.py). So not just rate limiting. If cache has the object, DB read is skipped. So this keeps that as it was which is good |
Summary
Companion PR to peermetrics/api#19 — the API now supports
?limit=&offset=on list endpoints.What changed
Conference list tab now uses server-side pagination:
?limit=20&offset=NtotalCountfrom API response for pagination controlsGraphs tab is unchanged — still loads all conferences for charting. This is fast now because the API no longer inlines participants/issues on the list endpoint (N+1 eliminated in api#19).
Files changed
app-dashboard/components/app.vuefetchConferences()methodapp-dashboard/components/conferencesTab.vuepage-changedeventTest plan
Dependencies
?limit=&offset=support)